<template>
  <div>
    <el-card class="box-card" style="margin-top: 10px;" shadow="never">
          <el-descriptions title="详情" size="medium" :column="4" >
            <el-descriptions-item label="状态">
              <span :class="'badge-status-do badge-status-'+machine.status"/>
              <dict-tag :options="dict.type.kw_host_status" :value="machine.status"/>
            </el-descriptions-item>
            <el-descriptions-item label="主机名">{{machine.hostName}}</el-descriptions-item>
            <el-descriptions-item label="机房">{{machine.idc}}</el-descriptions-item>
            <el-descriptions-item label="SSH端口">{{machine.sshPort}}</el-descriptions-item>
            <el-descriptions-item label="主机类型">
              <dict-tag :options="dict.type.kw_machine_type" :value="machine.serverType"/>
            </el-descriptions-item>
            <el-descriptions-item label="操作系统">{{machine.os}}</el-descriptions-item>
            <el-descriptions-item label="处理器">{{machine.cpu}}</el-descriptions-item>
            <el-descriptions-item label="网卡名称">{{machine.netCardName}}</el-descriptions-item>
            <el-descriptions-item label="磁盘使用"></el-descriptions-item>
            <el-descriptions-item label="时区"></el-descriptions-item>
            <el-descriptions-item label="当前时间"></el-descriptions-item>
            <el-descriptions-item label="时钟偏移"></el-descriptions-item>
            <el-descriptions-item label="备注" :span="4">{{machine.comment}}</el-descriptions-item>
          </el-descriptions>
    </el-card>
    <el-card style="margin-top: 20px;" shadow="never">
        <template slot-scope="header">
          <span class="el-descriptions__title">磁盘使用</span>
        </template>
        <el-table>
          <el-table-column>test</el-table-column>
        </el-table>
    </el-card>
  </div>
</template>

<script>
import { getMachine } from "@/api/machine/machine";
export default {
  name: "MachineBasic",
  props:["machineId"],
  dicts: ['kw_machine_type','kw_host_status'],
  comments:{
  },
  data() {
    return {
      machine:{},
    };
  },
  created() {
    this.getMachineBasic();
  },
  methods: {
    getMachineBasic(){
      getMachine(this.machineId).then( res => {
        this.machine = res.data;
      })
    },
    backTo(){
      this.$router.push("/machine");
    },
  }
};
</script>
